package com.itheima.d7_generics_interface;

import java.util.ArrayList;

public class Impl1 implements OperateImpl<Teacher> {
    @Override
    public void printAll(ArrayList<Teacher> list) {
        for (int i = 0; i < list.size(); i++) {
            Teacher s = list.get(i);
            System.out.println(s.getName()+" "+  s.getSex()+ " "+ s.getScore());
        }
        System.out.println("======================");
    }

    @Override
    public void printEve(ArrayList<Teacher> list) {
        double sum = 0;
        for (int i = 0; i < list.size(); i++) {
            Teacher s = list.get(i);
            sum += s.getScore();
        }
        System.out.println("班级平均分是"+sum/list.size());
    }
}
